<template>
	<view class="cnee-card">
		<view class="card-left">
			<view class="card-left-header">
				<text>{{cneeData.name}}</text>
				<text style="padding-left: 20rpx">{{cneeData.phone}}</text>
				<text class="radius-box" v-if="cneeData.isDefault">默认</text>
				<text class="radius-box" style="color:#f00 ;background-color: #fde6e9;"
					v-if="cneeData.tag">{{cneeData.tag}}</text>
			</view>
			<view class="card-left-body">
				{{address}}
			</view>
		</view>
		<navigator :url="`/subpkg/modify-address/modify-address?cneeId=${cneeData._id}`" hover-class="none"
			style="margin-left: 50rpx;" @click.stop>
			<uni-icons type="compose" size="25"></uni-icons>
		</navigator>
	</view>
</template>

<script>
	export default {
		name: "cnee-card",
		props: {
			cneeData: {
				type: Object,
				default: {},
			}
		},
		data() {
			return {};
		},
		computed: {
			address() {
				let {
					city,
					address,
					doorplate
				} = this.cneeData;
				return city + ' ' + address + doorplate;
			}
		},
	}
</script>

<style lang="scss">
	.cnee-card {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 25rpx 20rpx;
		border-radius: 15rpx;
		background-color: #fff;
		box-shadow: 0 0 5px 1px #ccc;

		.card-left {
			flex: 1;
			font-size: 28rpx;
			overflow: hidden;

			.card-left-header {
				padding-bottom: 20rpx;
			}
		}
	}

	.radius-box {
		height: 30rpx;
		padding: 0 8rpx;
		margin-left: 20rpx;
		font-size: 25rpx;
		color: #fff;
		border-radius: 16rpx;
		background-color: #f00;
	}
</style>
